import { createApp } from "vue";
import App from "./App.vue";
/**CSS重置样式表 */
import "@/styles/reset.scss";
/**CSS通用样式表 */
import "@/styles/common.scss";
/**iconfont */
import "//at.alicdn.com/t/c/font_4185728_rvhjnubftdt.js";
// import "@/assets/iconfont/iconfont.js";
/**font css */
import "@/assets/fonts/font.scss";
/**element css */
import "element-plus/dist/index.css";
// element dark css
import "element-plus/theme-chalk/dark/css-vars.css";
// custom element dark css
import "@/styles/element-dark.scss";
// custom element css
import "@/styles/element.scss";
// svg icons
import "virtual:svg-icons-register";
// element plus
import ElementPlus from "element-plus";
// element icons
import * as Icons from "@element-plus/icons-vue";
// custom directives
import directives from "@/directives/index";
// vue Router
import router from "@/routers";
// vue i18n
import I18n from "@/languages/index";
// pinia store
import pinia from "@/stores";
// errorHandler
import errorHandler from "@/utils/errorHandler";
// whjxtech 组件库
import JxtechComponent from "@whjxtech/jxtech-component";
// whjxtech 样式
import "@whjxtech/jxtech-component/es/index.css";
/**element-plus 的ui框架国际化语言配置 */
import zhCnLocale from "element-plus/es/locale/lang/zh-cn";
// 重写element样式
import "@/styles/el-cover/index.scss";
// 重写ext组件
import JxtechWebStarterComponents from "@/comp-ext";
// 引入乾坤
import { qiankunInit } from "@/qiankun";
// 使用乾坤启动函数
qiankunInit();

const app = createApp(App);

app.config.errorHandler = errorHandler;

// 注册元素Icons组件
Object.keys(Icons).forEach(key => {
  app.component(key, Icons[key as keyof typeof Icons]);
});

app
  .use(ElementPlus)
  .use(directives)
  .use(router)
  .use(I18n)
  .use(pinia)
  .use(JxtechComponent, { locale: zhCnLocale })
  .use(JxtechWebStarterComponents)
  .mount("#app");
